﻿#parse("partials/header.html") #parse("partials/sidebar.html")
<script type="text/javascript">
    var roleid;
    $(document).ready(function () {
        roleid = "$roleid";
        jQuery("#actiongroup").change(function () {
            //alert($("#actiongroup").val());
            $("#listAction").load("/admins/role/actionlist/?roleid=" + roleid + "&groupid=" + $("#actiongroup").val());
        });
        $("#checkall").click(function () {
            var dt = $(this).is(':checked');
            $('#listAction :checkbox').each(function () {
                $(this).attr('checked', dt);
            })
        });
    });
</script>

<script type="text/javascript">
    jQuery(document).ready(function () {     
        jQuery("#FormActionRole").submit(
            function () {
                if (jQuery("#FormActionRole").valid() == true) {
                    jQuery.blockUI();
                    var post_data = jQuery(this).serialize();
                    var form_action = jQuery(this).attr("action");
                    var form_method = jQuery(this).attr("method");
                    jQuery.ajax({
                        type: form_method,
                        url: form_action,
                        cache: false,
                        dataType: "json",
                        data: post_data,
                        success: function (data) {
                            jQuery("#notif").html(data['strNotification']);
                            jQuery.unblockUI();
                        },
                        error: function (data) {
                            jQuery.unblockUI();
                        },
                        complete: function () {

                        }
                    });
                }
                return false;
            });
    });
</script>
   <style>
    div#datalist_filter 
    {
        display:none;
    }
    div#datalist_length 
    {
        display:none;
    }
    .mws-table thead 
    {
        margin-top:-10px;
    }
</style>
<div id="mws-container" class="clearfix">
    <!-- Inner Container Start -->
    <div class="container">
        <!-- Panels Start -->
        <div class="mws-panel grid_8">
            <div class="mws-panel-header">
                <span class="mws-i-24 i-table-1">$Pagetitle</span>
            </div>
            <div class="mws-panel-body">
                <div class="mws-panel-toolbar top clearfix">
                    <ul>
                        <li><a class="mws-ic-16 ic-arrow-left" href="/admins/role/" title="Accept">Back To List Role</a></li>
                    </ul>
                </div>
               <div id= "notif">$Notification</div>
                
                <div class="mws-form" action="#">
                    <div class="mws-form-inline">
                    <form method="post" action="/admins/role/saverolesacrtiontoservice/" id="FormActionRole" class="crud">
                    <input type="hidden" value="$roleid" name="roleid" id="roleid" />
                        <div class="mws-form-row">
                            <label>
                                Module Name</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                             <!--<input class="validate[required] text-input, lf  mws-textinput" id="Text1" name="DescValue"
                                        type="text" value="$sysRole.DescValue" />-->
                                        $ddActionGroup
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                           
                             #foreach($item in $roleAction)
                                    #beforeall
                                        <table class="mws-table" style="width:100%">
                                            <thead>
                                            <tr>
                                                <th style="text-align: center; width: 20px">
                                                    <input type="checkbox" id="checkall" name= "checkall" />
                                                </th>
                                                <th style="text-align: center;">Action Name</th>
                                            </tr>
                                            </thead>
                                            <tbody id="listAction">
                                    #before
                                           <tr 
                                    #odd
                                           class='odd'>
                                    #even
                                           class='even'>

                                    #each
                                           <td >
                                           #if($item.RoleID == "0")
                                           <input type="checkbox" name="valueaction" value="$item.Id" />
                                           #else
                                           <input type="checkbox" name="valueaction" value="$item.Id" checked="checked"/>
                                           #end
                                           </td>
                                           <td>$item.DescValue</td>
                                    #after
                                           </tr>
                                    #afterall
                                           </tbody>
                                       </table>
                                    #nodata
                                           Sorry no data Found!
                                    #end
                                       
                        </div>
                            <div class="mws-button-row">
                            <input name="btnAction" class="mws-button red" type="submit" value="Save" />
                            <input class="mws-button gray" type="reset" value="Reset" />
                        </div>
                    </form>
                </div>
                
            </div>
        </div>
        <!-- Panels End -->
    </div>
    <!-- Inner Container End -->
</div>
#parse("partials/footer.html")

